package hello;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;

@Controller
@EnableAutoConfiguration
public class SampleController {

    @RequestMapping("/")
    @ResponseBody
    String home() {
    	
        return env.getProperty("server.port");
    }
    
    @Autowired
    Environment env;

    public static void main(String[] args) throws Exception {
        SpringApplication.run(SampleController.class, args);
    }
}